/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Domain;

import java.io.Serializable;

/**
 *
 * @author Mattis
 */
public class State implements Serializable{
    
    private GameGrid gameGrid;
    
    private double value = 0.0;
    
    private int nrOfVisits = 1; // this is k in the formula in chapter 2.5 figure 2.4 in the book RL
    
    public State(GameGrid gameGrid){
        this.gameGrid = gameGrid;
        this.nrOfVisits = 1;
    }
    
    public State(double value){
        this.value = value;
    }
    
    public static void main(String[] args){
        State state = new State(new GameGrid());
        System.out.println("" + state.toString());
    }
    
    public void visitState(){
        nrOfVisits++;
    }
    
    public int getNrOfVisits(){
        return this.nrOfVisits;
    }
    
    public GameGrid getGameGrid(){
        return this.gameGrid;
    }
    
    
    public void setValue(double value){
        this.value = value;
    }
    
    public double getValue(){
        return this.value;
    }
    
    @Override
    public String toString(){
        return gameGrid.toString();
        /*String temp = "";
        for(int i = 0; i < GameGrid.GRID_ROWS; i++){
            for(int j = 0; j < GameGrid.GRID_COLUMNS; j++){
                temp = temp + " " + this.gameGrid.getDisc(i, j).ordinal();
            }
        }
        return temp;/**/
    }
    
    
}
